<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台登录-X-admin2.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/P201704/bbs/Public/Admin/css/font.css">
	<link rel="stylesheet" href="/P201704/bbs/Public/Admin/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="/P201704/bbs/Public/Admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/P201704/bbs/Public/Admin/js/xadmin.js"></script>

</head>
<form action="" method="post" class="layui-form layui-form-pane">
                <div class="layui-form-item">
                    <label for="name" class="layui-form-label">
                        <span class="x-red">*</span>角色名
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" name="name" required="" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">
                        拥有权限
                    </label>
                    <table class="layui-table layui-input-block">
                        <tbody>
                            <tr>
                                <td>
                                    文章管理
                                    <input type="checkbox" name="" lay-skin="primary" lay-filter="aihao">
                                </td>
                                <td>
                                    <div class="layui-input-block">
                                        <input type="checkbox" name="" title="写作" lay-skin="primary" >
										<input type="checkbox" name="" title="发呆" lay-skin="primary"> 
										<input type="checkbox" name="" title="禁用" lay-skin="primary" disabled> 
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label for="desc" class="layui-form-label">
                        描述
                    </label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" id="desc" name="desc" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                <button class="layui-btn" lay-submit="" lay-filter="add">增加</button>
              </div>
            </form>
 <script>
	layui.use('form', function(){
	  var form = layui.form;
	  
	  
	  	form.on("checkbox(aihao)", function(data){
		  console.log(data.elem); //得到checkbox原始DOM对象

		  $(data.elem).parent().siblings().find('input').prop("checked", true);
		  form.render('checkbox');

		  // console.log(data.elem.checked); //是否被选中，true或者false
		  // console.log(data.value); //复选框value值，也可以通过data.elem.value得到
		  // console.log(data.othis); //得到美化后的DOM对象
		});    
	});
</script>